/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javagprssrv.DataBase;

import java.util.ArrayList;
import java.util.List;
import javagprssrv.JGS_Param;
import org.apache.log4j.Logger;

/**
 * 批量插入不成功数据移入另一队列。 由此线程取出，诼条取出执行插入
 * @author dusin
 */
public class Insert5mEachThread extends Thread {

    public Insert5mEachThread() {
        super("Insert5mEachThread");
    }

    
    Logger logger = Logger.getLogger(Insert5mEachThread.class);
    DBSQLExecute dbse = new DBSQLExecute();

    @Override
    public void run() {
        while (true) {
            try {
                Thread.sleep(20L);
            } catch (InterruptedException ex) {

            }
            try {
                int count = 0;
                Object[] bean = null;
                bean = JGS_Param.queueForEach5m.take();
                if (bean != null) {
                    dbse.doCreate5m(bean);
                    logger.info("成功插入1条5m钟数据"+bean);
                }
                bean = null;

            } catch (Exception e) {  
                e.printStackTrace();
            }

        }
    }
}
